<include file="Public:top" />
<style>
input{margin-bottom:10p;}
tr{ height:30px;}
</style>
<script>
var editor;
</script>
<div id="main" class="" >
<div class="content">
<div class="title">{$vo.sName}单位安全生产信息管理  [ <a href="__URL__">返回列表</a> ]</div>
<form method="post" id="form2" name="form2">
<table width="90%" cellpadding=3 cellspacing=3>
<tr>
	<td width="133" class="tRight" >安全通道：</td>
	<td width="170" class="tLeft" >{$vo.aqtd|getAqInfo='aqtd',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_aqtd_d" f="aqtd_d" s="安全通道详细情况">详细</a>]</td>
    
    <td width="136" class="tRight" >保安是否有培训：</td>
	<td width="170" class="tLeft" >{$vo.bapx|getAqInfo='bapx',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_bapx_d" f="bapx_d" s="保安是还是培训">详细</a>]</td>
</tr>
<tr>
	<td class="tRight" >灭火器：</td>
	<td class="tLeft" >{$vo.mhq|getAqInfo='mhq',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_mhq_d" f="mhq_d" s="灭火器">详细</a>]</td>
    
    <td class="tRight" >门岗24小时值班：</td>
	<td class="tLeft" >{$vo.mgzb|getAqInfo='mgzb',1}</td>
    <td class="tLeft">[<a href="#" id="a_mgzb_d" f="mgzb_d" s="门岗24小时值班详细情况">详细</a>]</td>
</tr>
<tr>
	<td class="tRight" >消防栓：</td>
	<td class="tLeft" >{$vo.xfs|getAqInfo='xfs',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_xfs_d" f="xfs_d" s="消防栓">详细</a>]</td>
    
    <td class="tRight" >建立来访登记：</td>
	<td class="tLeft" >{$vo.lfdj|getAqInfo='lfdj',1}</td>
    <td class="tLeft">[<a href="#" id="a_lfdj_d" f="lfdj_d" s="来访登记详细情况">详细</a>]</td>
</tr>
<tr>
	<td class="tRight" >强电线路：</td>
	<td class="tLeft" >{$vo.dx|getAqInfo='dx',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_dx_d" f="dx_d" s="强电线路">详细</a>]</td>
    
    <td class="tRight" >是视频监控系统：</td>
	<td class="tLeft" >{$vo.spjk|getAqInfo='spjk',1}</td>
    <td class="tLeft">[<a href="#" id="a_spjk_d" f="spjk_d" s="是否建立视频监控系统">详细</a>]</td>
</tr>
<tr>
	<td class="tRight" >台风引发空飘物：</td>
	<td class="tLeft" >{$vo.kpwt|getAqInfo='kpwt',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_kpwt_d" f="kpwt_d" s="台风引发空飘物">详细</a>]</td>
    
    <td class="tRight" >有线外监控系统：</td>
	<td class="tLeft" >{$vo.hwjk|getAqInfo='hwjk',1}</td>
    <td class="tLeft">[<a href="#" id="a_hwjk_d" f="hwjk_d" s="是否建立视频监控系统">详细</a>]</td>
</tr>
<tr>
	<td class="tRight" >燃汽油使用存放：</td>
	<td class="tLeft" >{$vo.rqy|getAqInfo='rqy',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_rqy_d" f="rqy_d" s="燃汽油使用存放">详细</a>]</td>
    
    <td class="tRight" >避雷设施符合要求：</td>
	<td class="tLeft" >{$vo.blxt|getAqInfo='blxt',1}</td>
    <td class="tLeft">[<a href="#" id="a_blxt_d" f="blxt_d" s="避雷设施符合要求">详细</a>]</td>
</tr>
<tr>
	<td class="tRight" >电器使用情况：</td>
	<td class="tLeft" >{$vo.dqsy|getAqInfo='dqsy',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_dqsy_d" f="dqsy_d" s="电器使用情况">详细</a>]</td>
    
    <td class="tRight" >饮用水符合要求：</td>
	<td class="tLeft" >{$vo.yys|getAqInfo='yys',1}</td>
    <td class="tLeft">[<a href="#" id="a_yys_d" f="yys_d" s="饮用水符合要求">详细</a>]</td>
</tr>
<tr>
	<td class="tRight" >悬挂物安全否：</td>
	<td class="tLeft" >{$vo.xgw|getAqInfo='xgw',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_xgw_d" f="xgw_d" s="悬挂物安全否">详细</a>]</td>
    
    <td class="tRight" >车辆年检：</td>
	<td class="tLeft" >{$vo.clnj|getAqInfo='clnj',1}</td>
    <td class="tLeft">[<a href="#" id="a_clnj_d" f="clnj_d" s="车辆年检">详细</a>]</td>
</tr>
<tr>
	<td class="tRight" >实验药品管理：</td>
	<td class="tLeft" >{$vo.syyp|getAqInfo='syyp',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_syyp_d" f="syyp_d" s="实验药品管理">详细</a>]</td>
    
    <td class="tRight" >专职司机驾驶证：</td>
	<td class="tLeft" >{$vo.sjnj|getAqInfo='sjnj',1}</td>
    <td class="tLeft">[<a href="#" id="a_sjnj_d" f="sjnj_d" s="专职司机驾驶证">详细</a>]</td>
</tr>
<tr>
	<td class="tRight" >活动空间有无锐器：</td>
	<td class="tLeft" >{$vo.rq|getAqInfo='rq',1}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_rq_d" f="rq_d" s="活动空间有无锐器">详细</a>]</td>
    
    <td class="tRight" ></td>
	<td class="tLeft" ></td>
    <td class="tLeft"></td>
</tr>
<tr>
	<td class="tRight" >各类设施检修记录：</td>
	<td class="tLeft" >{$vo.jxjl}</td>
    <td width="100" class="tLeft">[<a href="#" id="a_jxjl_d" f="jxjl_d" s="各类设施检修记录">详细</a>]</td>
    
    <td class="tRight" >存在问题及整改意见：</td>
	<td class="tLeft" >{$vo.zgyj}</td>
    <td class="tLeft">[<a href="#" id="a_zgyj_d" f="zgyj_d" s="存在问题及整改意见">详细</a>]</td>
</tr>

<tr>
	<td colspan="7" align="center"><input type="hidden" name="dwid" value="{$vo.dwid}" >
	  <input type="hidden" name="ajax" value="1">
	  <input type="button" value="保 存" onclick="save()" class="small submit">
	  <!--<input type="reset" class="submit small" value="清 空" >--></td>
	</tr>
</table>
</form>
</div>
</div>
<style>
.dlg{ height:520px; width:930px; top:2px; position:static; float:left;}
.dlg1{ height:500px; width:910px; float:left;}
</style>
<div class="hide" style="height:100%" id="hideDiv">
    <div id="dlg_aqtd_d" class="dlg"><div id="div_aqtd_d" class="dlg1" f='aqtd_d'>{$vo.aqtd_d}</div></div>
    <div id="dlg_bapx_d" class="dlg"><div id="div_bapx_d" class="dlg1" f='bapx_d'>{$vo.bapx_d}</div></div>
    <div id="dlg_mhq_d" class="dlg"><div id="div_mhq_d" class="dlg1" f='mhq_d'>{$vo.mhq_d}</div></div>
    <div id="dlg_mgzb_d" class="dlg"><div id="div_mgzb_d" class="dlg1" f='mgzb_d'>{$vo.mgzb_d}</div></div>
    <div id="dlg_xfs_d" class="dlg"><div id="div_xfs_d" class="dlg1" f='xfs_d'>{$vo.xfs_d}</div></div>
    <div id="dlg_lfdj_d" class="dlg"><div id="div_lfdj_d" class="dlg1" f='lfdj_d'>{$vo.lfdj_d}</div></div>
    <div id="dlg_dx_d" class="dlg"><div id="div_dx_d" class="dlg1" f='dx_d'>{$vo.dx_d}</div></div>
    <div id="dlg_spjk_d" class="dlg"><div id="div_spjk_d" class="dlg1" f='spjk_d'>{$vo.spjk_d}</div></div>
    <div id="dlg_kpwt_d" class="dlg"><div id="div_kpwt_d" class="dlg1" f='kpwt_d'>{$vo.kpwt_d}</div></div>
    <div id="dlg_hwjk_d" class="dlg"><div id="div_hwjk_d" class="dlg1" f='hwjk_d'>{$vo.hwjk_d}</div></div>
    <div id="dlg_rqy_d" class="dlg"><div id="div_rqy_d" class="dlg1" f='rqy_d'>{$vo.rqy_d}</div></div>
    <div id="dlg_blxt_d" class="dlg"><div id="div_blxt_d" class="dlg1" f='blxt_d'>{$vo.blxt_d}</div></div>
    <div id="dlg_dqsy_d" class="dlg"><div id="div_dqsy_d" class="dlg1" f='dqsy_d'>{$vo.dqsy_d}</div></div>
    <div id="dlg_yys_d" class="dlg"><div id="div_yys_d" class="dlg1" f='yys_d'>{$vo.yys_d}</div></div>
    <div id="dlg_xgw_d" class="dlg"><div id="div_xgw_d" class="dlg1" f='xgw_d'>{$vo.xgw_d}</div></div>
    <div id="dlg_clnj_d" class="dlg"><div id="div_clnj_d" class="dlg1" f='clnj_d'>{$vo.clnj_d}</div></div>
    <div id="dlg_syyp_d" class="dlg"><div id="div_syyp_d" class="dlg1" f='syyp_d'>{$vo.syyp_d}</div></div>
    <div id="dlg_sjnj_d" class="dlg"><div id="div_sjnj_d" class="dlg1" f='sjnj_d'>{$vo.sjnj_d}</div></div>
    <div id="dlg_rq_d" class="dlg"><div id="div_rq_d" class="dlg1" f='rq_d'>{$vo.rq_d}</div></div>
    <div id="dlg_zgyj_d" class="dlg"><div id="div_zgyj_d" class="dlg1" f='zgyj_d'>{$vo.zgyj_d}</div></div>
    <div id="dlg_jxjl_d" class="dlg"><div id="div_jxjl_d" class="dlg1" f='jxjl_d'>{$vo.jxjl_d}</div></div>
    
    <div id="tempDiv"></div>
</div>
<include file="Public:footer" />
<script>
jQuery(function(){
	$("#a_aqtd_d,#a_bapx_d,#a_mhq_d,#a_mgzb_d,#a_xfs_d,#a_lfdj_d,#a_dx_d,#a_spjk_d,#a_kpwt_d,#a_hwjk_d,#a_rqy_d,#a_blxt_d,#a_dqsy_d,#a_yys_d,#a_xgw_d,#a_clnj_d,#a_syyp_d,#a_sjnj_d,#a_rq_d,#a_zgyj_d,#a_jxjl_d").click(function(){
		var ff = $(this).attr("f");//f用于表示操作的字段，
		var sf = $(this).attr("s");//s用于显示的标题
		$('#dlg_'+ff).unbind().bgiframe().dialog({
			onOpen:function(){
				$('html').addClass('hidescroll');},
			onClose:function(){
				$('html').removeClass('hidescroll');
				if(editor){ 
					$('#div_'+ff).html(editor.html());
					editor.remove();
					editor = null;
					window.location.reload();
				}
			},
			modal:true,title:sf+"使用详情查看修改对话框(双击进入编辑状态)",width:windowW,height:windowH,maximizable:true,resizable:true,
			buttons:[{
				text:'保存',iconCls:'icon-ok',
				handler:function(){
					if(!editor){ $('#dlg_'+ff).dialog('close');return;}
					var dwid 	= '{$Think.get.id}';
					$('#'+ff).html(editor.html());	
					var o		= {};//动态参数
					o[ff]		= editor.html();
					o['dwid']	= dwid;
					$.post("__URL__/update/",o,function(data){
						$.messager.show({title:'提示信息',msg:data.info,timeout:2000,showType:'slide'});
						if(data.status){ $('#dlg_'+ff).dialog('close');}
					}//function
					,"json");//post	
				}
			},{
				text:'关闭',handler:function(){
					$('#dlg_'+ff).dialog('close');
				}
			}]
		});	
		//不足5个字符时直接显示编辑器
		if($('#div_'+ff).html().length<5){
			editor = showEditor(ff,0,495);
		}else{
			jQuery('#dlg_'+ff).one('dblclick',function(){
				editor = showEditor(ff,0,495);
			})
		}
	})//click
	
	//查找详情里面的图片，并加个链接a标签，用于fancybox的图片集浏览	
	var aImg = $('#hideDiv img');
	var ff1 = "";//用于区分图片组的rel
	var temp= "";//用于临时记录上一次的rel，如果相同则不再添加节点
	aImg.each(function(i){
		ff1 = $(this).closest('.dlg1').attr('f');
		src = this.src;title = this.title;
		if(!$(this).parent().is('a')){
			if(temp!=ff1)
				$('#a_'+ff1).after("&nbsp;&nbsp;&nbsp;<a href='#' class='aGallay' title='"+ title +"' f='"+ff1+"'>图</a>");
			//$(this).wrap("<a href='"+ src +"' class='iGallay' rel='"+ ff1 +"' title='"+ title +"'></a>");
		}
		temp = ff1;
	})//each
	
	//给'图'a标签加个点击函数
	$('.aGallay').click(function(){
		f	= $(this).attr('f');
		$('#tempDiv').html($('#div_'+f).html());
		$('#tempDiv img').each(function(i){
			ff1 = $(this).closest('.dlg1').attr('f');
			src = this.src;title = this.title;
			if(!$(this).parent().is('a')){
				$(this).wrap("<a href='"+ src +"' class='iGallay' rel='"+ ff1 +"' title='"+ title +"'></a>");
			}
		})//each
		a = $('#tempDiv a').detach();	//将a标签从tempdiv中取出
		i = $('#tempDiv img').detach();	//将img标签从tempdiv中取出
		t	= $('#tempDiv').html();	//在tempdiv中只有text了！将t作为标题放入fancybox中
		$.fancybox( a ,{minWidth:'700px',autoSize:true,fitToView:true,openEffect:'fade',loop:false,
			helpers:{title:{type:'inside' }},
			afterLoad : function() {
					this.title = '[图片 ' + (this.index + 1) + ' of ' + this.group.length + ' ] ' +(this.title ? this.title: '') +'<br>'+t;
			}//function
		});	//fancybox
	})//click
	/////////////////////////////////////////////////////////////////////////////////////////

})
 
/*function showEditor(n,w,h){
	var ww = w>0?w+'px':'99%';
	var hh = h>0?h+'px':'99%';
	jQuery('#div_'+n).html("<TEXTAREA class=''  name='"+n+"' id='"+n+"'>"+$('#div_'+n).html()+"</textarea>");
	edt = KindEditor.create('textarea[name='+ n +']', {
		width:ww+'',height:hh+'',allowFileManager:true,
		items : [
			'source','fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
			'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
			'insertunorderedlist', '|', 'emoticons', 'image', 'link','flash','media','insertfile','map']
	});	
	return edt;
}*/
function save(){
    var inputs = $("#form2 :input").validator({ lang: 'zh',position: 'right left',offset: [-12, 0],message: '<div><em/></div>' });//不用检测表单
    if(inputs.data("validator").checkValidity()){
		var queryString = $('#form2').serialize();
		$.post('__URL__/update/',queryString,function(data){
			$.messager.show({
				title:'提示信息',msg:data.info,timeout:2000,showType:'slide'
			});
		},'json')	
	}	
}
</script>